<?php

namespace addons\groupon\controller;


class UserBank extends Base
{

    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];


    public function info()
    {
        $type = $this->request->get('type');

        $bankInfo = \addons\groupon\model\UserBank::info($type);
        
        $this->success('提现账户', $bankInfo);
    }


    public function edit () {
        $params = $this->request->post();
        if ($params['type'] === 'alipay') {
            $params['bank_name'] = '支付宝账户';
        }

        // 表单验证
        $this->grouponValidate($params, get_class(), 'edit');

        $this->success('编辑成功', \addons\groupon\model\UserBank::edit($params));
    }

}
